<?php
namespace app\admin\model;

use think\Model;
use think\Db;
use think\model\concern\SoftDelete;


class Cate extends Model
{
    use SoftDelete;
    protected $pk = 'id';
    protected $table = 'xc_cate';
    protected $autoWriteTimestamp = true;
    protected $deleteTime = 'delete_time';



    public function searchTitleAttr($query, $value){

        if ($value) {
            $query->where('title', 'like', '%' . $value . '%');
        }

    }

    public function getTypetitleAttr($value,$data)
    {
        $status = [1=>'案例',2=>'产品',3=>'技术支持',4=>'合作',5=>'关于',6=>'单页',7=>'默认',8=>'表单',9=>'链接',10=>'新闻'];
        return $status[$data['type']];
    }
}


?>